<!doctype html>
<html style="height:100%;">
<head>
    <meta charset="utf-8">
    <meta content="骡窝窝商城" http-equiv="keywords">
    <meta name="description" content="骡窝窝商城">
    <meta name="viewport" content="width=device-width,user-scalable=no, initial-scale=1">
    <title>骡窝窝商城</title>
    <link rel="stylesheet" href="css/index.css" type="text/css">
    <link rel="stylesheet" href="css/zy.css" type="text/css">
    <link rel="stylesheet" href="css/swiper.min.css" type="text/css">
    <script type="text/javascript" src="js/swiper.min.js"></script>
    <script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <script src="/js/common.js"></script>
    <script>
        $(function () {
            var params = getParams();
            var uId = params.id;
            var cIds = params.cids;
            console.log(cIds);
            //查询用户的收货地址
            $.get("/users/" + uId + "/adds", function (data) {
                //渲染数据
                $(".shouhdz_hk").renderValues(data);

                //勾选按钮绑定点击事件
                $(".yuanq").click(function () {
                    var n = $(this).next().find("em").html();
                    var m = $(this).next().find("p")[1];
                    var mm = $(m).html();
                    //设置勾选
                    $(this).find("i").addClass("cl");
                    //封装json对象
                    var add = {};
                    add.name = n;
                    add.address = mm;
                    var addStr = JSON.stringify(add);
                    //存到浏览器session
                    sessionStorage.setItem("add", addStr);
                    //跳转页面
                    parent.location.href = "orderPage.html?cids=" + cIds + "&id=" + uId;

                });
            });

            //跳转新增收货地址
            $("#newAdd").click(function () {
                var url = $(this).data("url");
                parent.location.href = url + uId;
            });
        });
    </script>
</head>
<body style="height: 100%;">
<!--页面内容
<div id="yemnr">-->
<!--头部-->
<div class="toub_beij toub_beij_zy">
    <div class="zhongj_k zhongj_k_z">
        <div class="jiu_feo">
            <div class="logo_k logo_k_fanh"><a href="javascript:history.go(-1);"><img class="fanh_ann" src="images/web/fanh.png"></a></div>
            <div class="zhongjain_daoh">
                <ul>
                    <li><a class="px24">收货地址</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    //滑动头部透明（针对首页头部用）
    window.onscroll = function () {

        var autoheight = document.body.scrollTop || document.documentElement.scrollTop;
        if (autoheight > 10) {
            $(".toub_beij").css("position", "fixed")
        } else {
            $(".toub_beij").css("position", "relative")
        }
    }
</script>
<!--内容-->
<div class="shouhdz_hk">
    <div class="shouh_zk" render-loop="list">
        <div class="shouh_dange_beijin">
            <div class="shang">
                <div class="yuanq" href="javascript:history.go(-1);"><i></i></div>
                <div class="mz">
                    <p><em class="name" render-html="list.name"></em></p>
                    <p render-html="list.contactWay"></p>
                </div>
            </div>
            <div class="boanjk"><a href="#">编辑</a></div>
        </div>
    </div>
</div>
<div class="dib_daoh_b">
    <div class="gouwuc_ Xinz">
        <a id="newAdd" data-url="newProductAdd.html?id=">新添收货地址</a>
    </div>
</div>


<!--大框div
</div>-->
<!--搜索页面-->
</body>
</html>

